## Author: Le Grace Huang
## Date: 2/19/2008
## Program: Reference Generator


# raw_input is better than input. Input can cause hack.
category = int(raw_input("Choose a Type of Reference:1)Book;2)a Chapter of a Book;3)a Journal Article;4)a Website: "))

print "your entered", category

if category == 1:

    author = raw_input("Author (Jordan, M. and Morgan, J.): ")
    title = raw_input("Title of Book: ")
    subtitle = raw_input("Subtitle of Book (please enter none if no subtitle): ")
    year = raw_input("Year of Publication: ")
    place = raw_input("Place of Publication: ")
    publisher = raw_input("Publisher: ")
    edition = raw_input("Edition (1st,2nd,3rd...): ")

    if subtitle == 'none':
        print author, "("+year+").", title+".", "("+edition+").", place+":", publisher+"."
    else:
        print author, "("+year+").", title+":", subtitle+".", "("+edition+").", place+":", publisher+"."

elif category ==  2:

    author = raw_input("Author(s) (Jordan, M. and Morgan, J.): ")
    chapter = raw_input("Title of the Chapter: ")
    pages = raw_input("Page numbers in the Book: ")
    editor = raw_input("Book Editor(s): ")
    title = raw_input("Title of Book: ")
    subtitle = raw_input("Subtitle of Book (please enter none if no subtitle): ")
    year = raw_input("Year of Publication: ")
    place = raw_input("Place of Publication: ")
    publisher = raw_input("Publisher: ")
    edition = raw_input("Edition (1st,2nd,3rd...): ")

    if subtitle == 'none':
        print author, "("+year+").", chapter+".", "In", editor+",", title, "(pp."+pages+").", "("+edition+").", place+":", publisher+"."
    else:
        print author, "("+year+").", chapter+".", "In", editor+",", title+":", subtitle+".", "(pp."+pages+").", "("+edition+").", place+":", publisher+"."

elif category ==  3:

    author = raw_input("Author(s) (Jordan, M. and Morgan, J.): ")
    title = raw_input("Title of Article: ")
    journal = raw_input("Title of Journal: ")
    volume = raw_input("Volume Number:")
    year = raw_input("Year of Publication: ")
    pages = raw_input("Pages: ")

    print author, "("+year+").", title+".", journal+",", volume+",", pages+"."

elif category == 4:

    author = raw_input("Author(s) (Jordan, M. and Morgan, J.): ")
    year = raw_input("Year of Publication: ")
    title = raw_input("Title of Article: ")
    date = raw_input("Retrieved on (date): ")
    website = raw_input("From which website: ")

    print author, "("+year+").", title+".", "Retrieved "+date+",", "from "+website+"."


